#pragma once
#include <iostream>
#include <fstream>
#include "word.h"
#include <time.h>

#include <string>
using namespace std;
class getRand{
public:
	int *dis;
	word *words;
	getRand(){

	}
	word *Rand(int ex,int total,word *wd){
	 
		dis=(int*)malloc(total*sizeof(int));
		for(int i=0;i<total;i++) dis[i]=0;
		
		words=new word[ex];
		
		for(int i=0;i<ex;i++){ int t=randomNum(total,ex); words[i]=wd[t];cout<<t<<endl;}
		 
		return words;
	}
 
	int randomNum(int total,int ex){
		int num;
		srand(time(NULL));
		while(1){
		
		num = abs(rand()) % total;		 
		
		if(dis[num]==0){				 
		 	dis[num]=1;
			
			return num;
		}
	}

	}
};